<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<% 
String qyId= request.getParameter("qyId");
%>
<!DOCTYPE HTML>
<html>
<head>
    <base href="${ctx }/">
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
    <link rel="stylesheet" href="plugin/bootstrap-3.3.7-dist/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="css/bootstrap-datetimepicker.css"/>
    <link rel="stylesheet" href="plugin/bootstrap-table/dist/bootstrap-table.css">
    <link rel="stylesheet" href="alert/alert.css">
    <style type="text/css">
       .addbr{
     float: right;
    margin-right: 80px;
  }
  .pad{
    padding-left:15px;
    padding-top:10px;
  }
  .im{
     padding:10px;
  }
  .padtr{
      margin-top:5px;
  }
.glyphicon-plus:before{
    color: #CCC;
}
.btn1{
    margin-top: 10px;
}
input{
    margin-top: 8px;
}
select{
margin-top: 8px;
}
.edui-container{
    margin-top: 8px;
}
input{
   width:130px!important;
}
@media (min-width: 1300px)
.container {
    width: 1296px;
}
    </style>
</head>
<body>
<div class="container-fluid">
    <div class="container row" id="query">
        <div>
            <ul class="breadcrumb">
                <li>
                    <i class="icon-home home-icon"></i>
                    <a href="javascript:void(0)">Cost Management(营销管理)</a>
                </li>
                <li class="active">
                    <a href="view/marketing/corporate_information.jsp">Corporate Accounts List(优惠劵发放列表)</a>
                </li>
                <li class="active">
                    <a href="javascript:void(0)">Corporate Voucher Records(发劵记录)</a>
                </li>
            </ul>
        </div>
        <div>
            <div class="form-inline" role="form" method="post" id="queryForm">
                <div class="form-group">
                    <label>Voucher Issue Time(发送时间):</label>
                    <input type="text" id="startTime"  class="form-control input-append form_date">-
                    <input type="text" id="endTime" class="form-control input-append form_date">
                </div>
                <div class="form-group">
                    <label>Voucher Serial Number(编号):</label>    
                    <input id='couponNo'  class="form-control"/>
                </div>
                  <div class="form-group">
                    <label>Voucher Code(优惠劵码):</label>
                    <input id='couponCode'  class="form-control"/>
                </div>
                 <div class="form-group">
                    <label>Voucher Name(优惠劵名称):</label>
                    <input id='couponName'  class="form-control"/>
                </div>
                <div class="form-group">
                    <label>Voucher Issuer Name(发劵者姓名):</label>
                    <input id='giftedPeopleName'  class="form-control"/>
                </div>
                <button id="queryBtn" onclick="doQuery1('demo-table',queryParams1())" class="btn btn-primary">Search
                </button>
            </div>
        </div>
        <br>
    </div>

    <table id="demo-table"></table>
</div>
</body>

<!-- 加载需要的js -->
<script src="js/jquery-3.2.1.min.js"></script>
<script src="plugin/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
<script src="js/jquery-bootstrap-pagination.js"></script>
<script src="plugin/bootstrap-table/dist/bootstrap-table.min.js"></script>
<script src="plugin/bootstrap-table/dist/locale/bootstrap-table-zh-CN.min.js"></script>

<!--时间  -->
<script src="js/bootstrap-datetimepicker.js"></script>
<script src="js/bootstrap-datetimepicker.zh-CN.js"></script>

<script src="js/common.js"></script>
<script src="plugin/layer/layer.js"></script>
<script type="text/javascript" charset="utf-8">

$('.form_date').datetimepicker({
    minView: "month", //选择日期后，不会再跳转去选择时分秒
    language: 'zh-CN',
    format: 'dd/mm/yyyy',
    todayBtn: 1,
    autoclose: 1,
});
    $(function () {
        initPath("${ctx }");
        initTable('demo-table', queryParams, columns, "user/userEnterpriseCoupon?qyId=<%=qyId%>");
    });
    var columns = [{field: '', title: 'Choose', checkbox: true},
        {
            field: 'couponNo',
            title: 'Voucher Serial Number(优惠劵码)',
            align: 'center',
            valign: 'middle'
        },
        {
            field: 'couponCode',
            title: 'Voucher Code(编号)',
            align: 'center',
            valign: 'middle'
        },
        {
            field: 'couponName',
            title: 'Voucher Name(优惠劵名称)',
            align: 'center',
            valign: 'middle'
        },
        {
            field: 'couponOffsetMoney',
            title: 'Voucher Value(优惠劵面额)',
            align: 'center',
            valign: 'middle'
        },
        {
            field: 'createTime',
            title: 'Voucher Issue Time(生成时间)',
            align: 'center',
            valign: 'middle',
            formatter: timeStamp2String
        },
        {
            field: 'giftedPeopleName',
            title: 'Voucher Issuer Name(发劵者账号)',
            align: 'center',
            valign: 'middle'
        },
        {
            field: 'telephone',
            title: 'Rider Name(乘客名称)',
            align: 'center',
            valign: 'middle'
        },
        {
            field: 'isUse',
            title: 'Used (Yes/No)(是否使用)',
            align: 'center',
            valign: 'middle',
            formatter: function (value, row, index) {return value==1?"NO":"YES";}
        },
        {
            field: 'payTime',
            title: 'Time of use(消费时间)',
            align: 'center',
            valign: 'middle',
            formatter: timeStamp2String
        },
        {
            field: 'orderNo',
            title: 'Order number(订单号)',
            align: 'center',
            valign: 'middle'
        }
    ];
   
    function queryParams(params) {
        var param = {
        		startTime: $('#startTime').val(),
        		endTime: $('#endTime').val(),
        		couponName: $('#couponName').val(), 
        		couponNo: $('#couponNo').val(),
        		couponCode: $('#couponCode').val(),
        		giftedPeopleName: $('#giftedPeopleName').val(),
            pageNo: this.pageNumber,
            pageSize: this.pageSize
        }
        return param;
    }

    function queryParams1() {
        var param = {
        		startTime: $('#startTime').val(),
        		endTime: $('#endTime').val(),
        		couponName: $('#couponName').val(),
        		couponNo: $('#couponNo').val(),
        		couponCode: $('#couponCode').val(),
        		giftedPeopleName: $('#giftedPeopleName').val(),
            pageNo: 1,
            pageSize: this.pageSize
        }
        return param;
    }
</script>
</html>


